package task;


import java.io.File;
import java.util.ArrayList;
import java.util.List;

import bean.Customer;
import javafx.concurrent.Task;
import util.ExcelUtil;

public class ExcelTask extends Task<List<Customer>> {

	private File file;

	public ExcelTask(File file) {
		this.file = file;
	}
	
	@Override
	protected List<Customer> call() throws Exception {
		List<Customer> cusList = new ArrayList<Customer>();
		if(!file.exists()){
			//文件为空
			return cusList;
		}else{
			//解析Excel文件
			cusList = ExcelUtil.parseExcel(file);
			return cusList;
		}
	}

}
